package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
)

type Stu struct {
	Name string `uri:"name"`
	Age  int
}

func main() {
	r := gin.Default()
	r.GET("/index/:name/:age", func(context *gin.Context) {
		var s Stu
		if err := context.BindUri(&s); err != nil {
			fmt.Printf("err: %v", err)
			context.JSON(http.StatusOK, gin.H{
				"msg": err,
			})
			return
		}
		context.JSON(http.StatusOK, gin.H{
			"msg": s,
		})

	})
	r.Run(":8090")
}
